package tabela;

import java.io.File;

import javax.swing.table.DefaultTableModel;

public class TabelaArquivosModel extends DefaultTableModel {

	private Class[] columnTypes;
	boolean[] columnEditables = new boolean[] { false, false, false };

	public TabelaArquivosModel() {

		super(new Object[][] { {null, null, null},} ,
				new String[] {"A\u00E7\u00E3o", "Arquivo", "Progresso"} );

		columnTypes = new Class[3];
		columnTypes[0] = Object.class;
		columnTypes[1] = String.class; 
		columnTypes[2] = Object.class;
		super.removeRow(0);
	}

	public Class getColumnClass(int columnIndex) {
		return columnTypes[columnIndex];
	}
	
	public boolean isCellEditable(int row, int column) {
		return columnEditables[column];
	}

		/*public void addTest(Test t, SwingWorker worker) {
	        Object[] obj = {number, t.getName(), t.getProgress()};
	        super.addRow(obj);
	        swmap.put(number, worker);
	        number++;
	    }*/
	public void addArq(File f) {
		Object[] obj = {null, f.getName(), null};
		super.addRow(obj);
		//super.fireTableDataChanged();
	}
	
}
